<div id="seat-table" class="hidden" data-attendee-count=<%=@current_table.present? ? @current_table.size : 0 %> ></div>

<div class="col-md-9" style="border-right-style: solid; border-right-color: #000">
  <div class="row m-b-md m-t-md">

    <div class="col-sm-3 m-b-xs hidden">
      <%=select_tag :seat_id, options_for_select(@table_rows), prompt: '请选择桌号（排号）', class: 'input-sm form-control input-s-sm inline'%>
    </div>

    <div class="col-sm-4">
      <div class="input-group">
        <input type="text" class="hidden" name="current_action" value="show_attendees" />
        <input type="text" class="hidden" name="session_id" value="<%= params[:session_id] %>" />
        <input type="text" id="keyword" placeholder="请输入关键字" class="input-sm form-control" name="keyword" value="<%=params[:keyword]%>">
        <span class="input-group-btn"><button id="search-button" class="btn btn-sm btn-primary">搜索</button> </span>
      </div>
    </div>
  </div>

  <div class="table-responsive">
    <table id="attendee-table" class="table table-striped table-hover">
      <thead>
      <tr>
        <th>序号</th>
        <th>姓名</th>
        <!-- <th>主嘉宾</th>
        <th>对应销售</th> -->
        <th>省</th>
        <th>市</th>
        <th>公司</th>
        <th>手机号码</th>
        <th>标签</th>
        <th class="hidden">attendee_id</th>
      </tr>
      </thead>
      <tbody>
      <% @attendees.each do |attendee| %>
        <tr>
          <td><%=attendee.attendee_number%></td>
          <td id="attendee-name"><%=attendee.name%></td>
          <!-- <td><%=attendee.owner_attendee.try(:name)%></td>
          <td><%=attendee.seller.try(:name)%></td> -->
          <td><%=attendee.province%></td>
          <td><%=attendee.city%></td>
          <td><%=attendee.company%></td>
          <td><%=attendee.mobile%></td>
          <td><%=attendee.category.try(:name)%></td>
          <td class="hidden"><%= attendee.id %></td>
        </tr>
      <% end %>
      </tbody>
    </table>
  </div>
  <div class="row">
    <div id="page-box" class="col-sm-12">
      <%= paginate @attendees %>
    </div>
  </div>
</div>

<div class="col-md-3">
  <button id="save-and-continue" type="button">保存</button>
  <div id="current-row" class="hidden" data-current-row=<%= @current_row %>>
  </div>
  <div id="current-event" class="hidden" data-current-event=<%= current_event.id %>>
  </div>
  <div id="total-table-count" class="hidden" data-total-table-count=<%=@current_session_seat.total_table_count%>>
  </div>
  <div id="per-table-num" class="hidden" data-per-table-num=<%= @current_session_seat.per_table_num%>>
  </div>
  <div id="current-session-id" class="hidden" data-current-session-id=<%= params[:session_id] %>>
  </div>

  <% if @current_row.to_i > @current_session_seat.total_table_count.to_i%>
    <div id="data" style="background-color: #999; color: #fff; align='center';"><%=@current_session_seat.total_table_count%>/<%=@current_session_seat.total_table_count%>桌</div>
  <% else %>
    <div id="data" style="background-color: #999; color: #fff; align='center';"><%=@current_row||'1' %>/<%= @current_session_seat.total_table_count %>桌</div>
  <% end %>

  <br>
  <br>
  <table id="wait-arrange-seat-attendee" class="table table-striped table-hover" style="border:1px solid #000">
    <% if @current_table.present? %>
      <% i = 0 %>
      <% @current_table.each do |seat| %>
        <% i += 1 %>
        <tr>
          <td class='arranged-attendee'>
            <span style='border:1px solid #000; width: 100%'>
              <%= i %><%= seat.attendee.name %>
              <i class='fa fa-times'></i>
            </span>
          </td>
          <td class="hidden">
            <%= seat.attendee.id %>
          </td>
        </tr>
      <% end %>
    <% end %>
  </table>
</div>
